import Vue from 'vue'
import Router from 'vue-router'
import { post, get } from '../request/api'
import { encrypt, decrypt } from '../utils/cryptojs'
import { FormItem } from 'element-ui'
import Cookies from 'js-cookie'
let loginPath = 'https://usercenter.bsedu.com/login'

if (process.env.NODE_ENV != "production") {
  if (process.env.NODE_ENV == "development") {
    loginPath = '/login'
  } else {
    loginPath = 'https://test-usercenter.bsedu.com/login'
  }
}
// 

const vm = new Vue();

Vue.use(Router)

//单校
// 个人中心
const Downloadcenter = () => import('../page/personalcenter/downloadcenter') //下载中心
const Personalinfor = () => import('../page/personalcenter/personalinfor') //个人信息
const Accountinfo = () => import('../page/personalcenter/accountinfo') //账号安全
const Messagecenter = () => import('../page/personalcenter/messagecenter') //消息中心



// //阅卷系统
const Login = () => import('../page/login/login') //账号登录
const ExamIndex = () => import('../page/exammanage/examIndex') //首页
const Addexam = () => import('../page/exammanage/addexam') //新建考试
const Circletemplate = () => import('../page/exammanage/circletemplate') //圈图模板
const Examoverview = () => import('../page/exammanage/examoverview') //考试概览
const Questionmanage = () => import('../page/exammanage/questionmanage') //试题管理
const Studentmanage = () => import('../page/exammanage/studentmanage') //学生管理
const Teachermanage = () => import('../page/exammanage/teachermanage') //教师管理
const Scorerelease = () => import('../page/exammanage/scorerelease') //成绩管理
const Taskallocation = () => import('../page/exammanage/taskallocation') //任务分配
const Reviewprogress = () => import('../page/exammanage/reviewprogress') //评阅进度
const Monitoringoverview = () => import('../page/exammanage/monitoringoverview') //监控概览
const Exceptionhandling = () => import('../page/exammanage/exceptionhandling') //异常处理
const Arbitrationprocessing = () => import('../page/exammanage/arbitrationprocessing') //仲裁处理
const Allocations = () => import('../page/exammanage/allocations') //分配设置
const Reviewmonitoring = () => import('../page/exammanage/reviewmonitoring') //评阅监控
const Allmonitoringoverview = () => import('../page/exammanage/allmonitoringoverview') //与全体一致性
const Abnormaltestpaper = () => import('../page/exammanage/abnormaltestpaper') //试卷异常
const Abnormalanswersheethandling = () => import('../page/exammanage/abnormalanswersheethandling') //异常答题卡处理
const Multievaluationmanagement = () => import('../page/exammanage/multievaluationmanagement') //多评管理
const Arbitrationhandling = () => import('../page/exammanage/arbitrationhandling') //仲裁
const Modifygrades = () => import('../page/exammanage/modifygrades') //修改成绩
const Templateinformation = () => import('../page/exammanage/templateinformation') //模板信息
const Horizontalpositioning = () => import('../page/exammanage/horizontalpositioning') //水平定位
const Locationarea = () => import('../page/exammanage/locationarea') //定位区域
const Admissionticketnumberarea = () => import('../page/exammanage/admissionticketnumberarea') //准考证号区域区域
const Objectivequestionarea = () => import('../page/exammanage/objectivequestionarea') //客观题区域
const Subjectivequestions = () => import('../page/exammanage/subjectivequestions') //主观题区域
const Identificationrecord = () => import('../page/exammanage/identificationrecord') //识别记录
const Notuploaded = () => import('../page/exammanage/notuploaded') //未上传记录
const Listofabsences = () => import('../page/exammanage/listofabsences') //缺考名单
const Batchscanning = () => import('../page/exammanage/batchscanning') //批次扫描
const Abnormalexamnumber = () => import('../page/exammanage/abnormalexamnumber') //考号异常处理
const Optionexception = () => import('../page/exammanage/optionexception') //选项异常处理
const Abnormalrating = () => import('../page/exammanage/abnormalrating') //打分异常处理
const Recognitionresult = () => import('../page/exammanage/recognitionresult') //识别结果记录





// 学校管理
const Studentinfo = () => import('../page/schoolmanage/studentinfo') //学生信息
const Teacherinfo = () => import('../page/schoolmanage/teacherinfo') //教师信息
const Grademanagement = () => import('../page/schoolmanage/grademanagement') //年级管理
const Classmanagement = () => import('../page/schoolmanage/classmanagement') //班级管理
const Subjectmanagement = () => import('../page/schoolmanage/subjectmanagement') //科目管理
const Subjectselectionmanagement = () => import('../page/schoolmanage/subjectselectionmanagement') //选科管理
const Topicmanagement = () => import('../page/schoolmanage/topicmanagement') //题型管理
const Taskset = () => import('../page/schoolmanage/taskset') //任务设置

// 作业管理
const Index = () => import('../page/index/index') //作业管理
const Homework = () => import('../page/schoolassignment/index') //作业管理
const Studentscore = () => import('../page/schoolassignment/studentscore') //学生成绩
const Homeidenificationrecord = () => import('../page/schoolassignment/identificationrecord') //作业识别记录
const Errorwork = () => import('../page/schoolassignment/errorwork') //错题本
const Homeabnormalexamnumber = () => import('../page/schoolassignment/abnormalexamnumber') //考号异常处理
const Homeoptionexception = () => import('../page/schoolassignment/optionexception') //选项异常处理
const Homeabnormalrating = () => import('../page/schoolassignment/abnormalrating') //打分异常处理
const mark = () => import('../page/schoolassignment/mark') 
const Unablefindanswersheet = () => import('../page/schoolassignment/unablefindanswersheet') //无法识别的试卷

//成绩管理
const Gradescoreindex = () => import('../page/grademanagement/index') //成绩管理
const Academiclevelsetting = () => import('../page/grademanagement/academiclevelsetting') //学业水平设置
const Scorerangesetting = () => import('../page/grademanagement/scorerangesetting') //分数段设置
const Rankingsegmentsetting = () => import('../page/grademanagement/rankingsegmentsetting') //名次段设置
const Classreport = () => import('../page/analysis/classreport') //班级分析
const Studentreport = () => import('../page/analysis/studentreport') //学生分析



const NotFoundComponent = () => import('../page/notfound')//404页面


const Dddimage = () => import('../page/dddimage')//404页面











//首页
// const Index = () => import('../page/index') //首页
// const Selectexam = () => import('../page/signup/selectexam') //选择考试
// const Examregistration = () => import('../page/signup/examregistration') //考试报名 选择学校
// const Informationsettings = () => import('../page/signup/informationsettings') //信息设置
// const Reportinformation = () => import('../page/reportinformation') //信息上报
// const Mymission = () => import('../page/mymission') //我的任务
// const Examlist = () => import('../page/examlist') //管理员账号
// const Totalmarkingprogress = () => import('../page/totalmarkingprogress') //查看阅卷进度
// const exammanagemarkingprogress = () => import('../page/exammanagemarkingprogress') //查看学校阅卷进度
// const Teachermarkingprogress = () => import('../page/teachermarkingprogress') //查看教师阅卷进度


// const Markingquestions = () => import('../page/markingpapers/markingquestions') //我的阅卷
// const Forgetpw = () => import('../page/markingpapers/forgetpw') //忘记密码

// //数据分析
// const Analysismain = () => import('../page/dataanalysis/analysismain') //分析主干
// const exammanagelevel = () => import('../page/dataanalysis/exammanagelevel') //单题预览
// const exammanagelevelold = () => import('../page/dataanalysis/children/exammanagelevelold')  //老高考 3+1+2  总分统计
// const Onlineanalysis = () => import('../page/dataanalysis/children/onlineanalysis')  //老高考 3+1+2  上线达标分析
// const Hitratecontribution = () => import('../page/dataanalysis/children/hitratecontribution') // 老高考 3+1+2 命中率与贡献度
// const Fractiondistribution = () => import('../page/dataanalysis/children/fractiondistribution') //老高考 3+1+2 分数段分布
// const Subjectanalysis = () => import('../page/dataanalysis/children/subjectanalysis') //老高考 3+1+2 各学科分析
// const Studentachievement = () => import('../page/dataanalysis/children/studentachievement') //老高考 3+1+2 学生成绩
// const Studentsmallquestion = () => import('../page/dataanalysis/children/studentsmallquestion') //老高考 3+1+2 学生小题分
// const Jointoverallstatistics = () => import('../page/dataanalysis/children/jointoverallstatistics') //联考 总体统计
// const Gradedlaunch = () => import('../page/dataanalysis/children/gradedlaunch') //联考 分档上线情况
// const Paperqualityanalysis = () => import('../page/dataanalysis/children/paperqualityanalysis') //联考 试卷质量分析
// const Studentperformance = () => import('../page/dataanalysis/children/studentperformance')  //联考 学生成绩
// const Disciplineanalysis = () => import('../page/dataanalysis/children/disciplineanalysis')
// const Classreport = () => import('../page/dataanalysis/classreport') //班级报告
// const Questiondetail = () => import('../page/dataanalysis/questiondetail') //单题预览
// const exammanagedetail = () => import('../page/dataanalysis/exammanagedetail') //单题预览
// const Jointexamination = () => import('../page/dataanalysis/jointexamination') //联考
// const Examinationdetail = () => import('../page/dataanalysis/examinationdetail') //联考

// //上传答题卡
// const Uploadcardselectexam = () => import('../page/uploadanswercard/selectexam') //上传答题卡列表
// const Taskallocation = () => import('../page/uploadanswercard/taskallocation') //任务分配
// const Answercard = () => import('../page/uploadanswercard/answercard') //上传答题卡
// const Answercardcircle = () => import('../page/uploadanswercard/answercardcircle') //上传答题卡
// const Answercardlist = () => import('../page/uploadanswercard/answercardlist') //答题卡列表
// const Reviseanswercard = () => import('../page/uploadanswercard/reviseanswercard') //修改异常列表
// const Notuploaded = () => import('../page/uploadanswercard/notuploaded') //未上传
// const Uploadcard = () => import('../page/uploadanswercard/upload') //答卷上传

// //学校管理
// const exammanagemangeselectexam = () => import('../page/exammanagemanagement/selectexam') //学校管理-选择考试
// const exammanagemangemain = () => import('../page/exammanagemanagement/main') //学校管理主干
// const exammanagebasicinfo = () => import('../page/exammanagemanagement/children/exammanagebasicinfo')  //学校管理 基本信息
// const Contactsinfo = () => import('../page/exammanagemanagement/children/contacts')  //学校管理 联系人信息
// const Contactlist = () => import('../page/exammanagemanagement/children/contactlist')  //学校管理 联系人信息
// const Teachermanagement = () => import('../page/exammanagemanagement/children/teachermanagement') //学校管理 教师管理
// const Studentmanagement = () => import('../page/exammanagemanagement/children/studentmanagement') //学校管理 学生管理
// const Onlineusers = () => import('../page/exammanagemanagement/children/onlineusers') //学校管理 上线人数
// const Importstudent = () => import('../page/exammanagemanagement/children/importstudent') //导入学生

// //管理员查看
// const Adminselectexam = () => import('../page/administrators/selectexam') //选择考试
// const exammanagesinfo = () => import('../page/administrators/exammanagesinfo') //各校报名信息
// const Uploadanswercards = () => import('../page/administrators/uploadanswercards') //各校上传答题卡
// const exammanageprogress = () => import('../page/administrators/exammanageprogress.vue') //各校阅卷进度
// const Subjectprogress = () => import('../page/administrators/subjectprogress.vue') //各校学科阅卷进度
// const exammanagelist = () => import('../page/administrators/exammanagelist.vue') //选择学校

// //回评
// const Reviewlist = () => import('../page/reviewlist') //回评列表
// const Reviewcon = () => import('../page/markingpapers/review') //回评

// //公告
// const Notice = () => import('../page/notice/notice') //公告列表
// const Noticelist = () => import('../page/notice/children/noticelist') //公告列表
// const Noticedetail = () => import('../page/notice/children/noticedetail') //公告详情

// //手机页面
// const Mobile = () => import('../page/phone/mobile') //手机阅卷

// //测试扫描
// const Textscan = () => import('../page/textscan') //测试扫描

// //条形码
// const Barcode = () => import('../page/barcode') //条形码

const router = new Router({
  base: '',
  mode: 'history',
  // mode:'hash',
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login,
      meta: { title: '百师云阅卷系统' }
    },
    {
      path: '/index',
      name: 'Index',
      component: Index,
      meta: { title: '百师云阅卷系统' }
    },
    {
      path: '/examindex',
      name: 'ExamIndex',
      component: ExamIndex,
      meta: { title: '百师云阅卷系统', isLogin: true }
    },
    {
      path: '/addexam',
      name: 'Addexam',
      component: Addexam,
      meta: { title: '百师云阅卷系统-新建考试', isLogin: true }
    },
    {
      path: '/circletemplate',
      name: 'Circletemplate',
      component: Circletemplate,
      meta: { title: '百师云阅卷系统-模板', isLogin: true }
    },
    {
      path: '/examoverview',
      name: 'Examoverview',
      component: Examoverview,
      meta: { title: '百师云阅卷系统-考试概览', isLogin: true }
    },
    {
      path: '/questionmanage',
      name: 'Questionmanage',
      component: Questionmanage,
      meta: { title: '考试概览-试题管理', isLogin: true }
    },
    {
      path: '/studentmanage',
      name: 'Studentmanage',
      component: Studentmanage,
      meta: { title: '考试概览-学生管理', isLogin: true }
    },
    {
      path: '/teachermanage',
      name: 'Teachermanage',
      component: Teachermanage,
      meta: { title: '考试概览-教师管理', isLogin: true }
    },
    {
      path: '/scorerelease',
      name: 'Scorerelease',
      component: Scorerelease,
      meta: { title: '考试概览-教师管理', isLogin: true }
    },
    {
      path: '/taskallocation',
      name: 'Taskallocation',
      component: Taskallocation,
      meta: { title: '考试概览-任务分配', isLogin: true }
    },
    {
      path: '/reviewprogress',
      name: 'Reviewprogress',
      component: Reviewprogress,
      meta: { title: '考试概览-评阅进度', isLogin: true }
    },
    {
      path: '/monitoringoverview',
      name: 'Monitoringoverview',
      component: Monitoringoverview,
      meta: { title: '考试概览-监控概览', isLogin: true }
    },
    {
      path: '/exceptionhandling',
      name: 'Exceptionhandling',
      component: Exceptionhandling,
      meta: { title: '考试概览-异常处理', isLogin: true }
    },
    {
      path: '/arbitrationprocessing',
      name: 'Arbitrationprocessing',
      component: Arbitrationprocessing,
      meta: { title: '考试概览-仲裁处理', isLogin: true }
    },
    {
      path: '/allocations',
      name: 'Allocations',
      component: Allocations,
      meta: { title: '考试概览-分配设置', isLogin: true }
    },
    {
      path: '/reviewmonitoring',
      name: 'Reviewmonitoring',
      component: Reviewmonitoring,
      meta: { title: '考试概览-评阅监控', isLogin: true }
    },
    {
      path: '/allmonitoringoverview',
      name: 'Allmonitoringoverview',
      component: Allmonitoringoverview,
      meta: { title: '考试概览-与全体一致性', isLogin: true }
    },
    {
      path: '/abnormaltestpaper',
      name: 'Abnormaltestpaper',
      component: Abnormaltestpaper,
      meta: { title: '考试概览-试卷异常', isLogin: true }
    },
    {
      path: '/abnormalanswersheethandling',
      name: 'Abnormalanswersheethandling',
      component: Abnormalanswersheethandling,
      meta: { title: '考试概览-异常答题卡处理', isLogin: true }
    },
    {
      path: '/multievaluationmanagement',
      name: 'Multievaluationmanagement',
      component: Multievaluationmanagement,
      meta: { title: '考试概览-多评管理', isLogin: true }
    },
    {
      path: '/arbitrationhandling',
      name: 'Arbitrationhandling',
      component: Arbitrationhandling,
      meta: { title: '考试概览-仲裁处理', isLogin: true }
    },
    {
      path: '/modifygrades',
      name: 'Modifygrades',
      component: Modifygrades,
      meta: { title: '考试概览-修改成绩', isLogin: true }
    },
    {
      path: '/templateinformation',
      name: 'Templateinformation',
      component: Templateinformation,
      meta: { title: '考试概览-模板信息上传', isLogin: true }
    },
    {
      path: '/horizontalpositioning',
      name: 'Horizontalpositioning',
      component: Horizontalpositioning,
      meta: { title: '考试概览-水平定位', isLogin: true }
    },
    {
      path: '/locationarea',
      name: 'Locationarea',
      component: Locationarea,
      meta: { title: '考试概览-定位区域', isLogin: true }
    },
    {
      path: '/admissionticketnumberarea',
      name: 'Admissionticketnumberarea',
      component: Admissionticketnumberarea,
      meta: { title: '考试概览-准考证区域', isLogin: true }
    },
    {
      path: '/objectivequestionarea',
      name: 'Objectivequestionarea',
      component: Objectivequestionarea,
      meta: { title: '考试概览-客观题区域', isLogin: true }
    },
    {
      path: '/subjectivequestions',
      name: 'Subjectivequestions',
      component: Subjectivequestions,
      meta: { title: '考试概览-主观题区域', isLogin: true }
    },
    {
      path: '/identificationrecord',
      name: 'Identificationrecord',
      component: Identificationrecord,
      meta: { title: '考试概览-识别记录', isLogin: true }
    },
    {
      path: '/notuploaded',
      name: 'Notuploaded',
      component: Notuploaded,
      meta: { title: '考试概览-未上传记录', isLogin: true }
    },
    {
      path: '/listofabsences',
      name: 'Listofabsences',
      component: Listofabsences,
      meta: { title: '考试概览-缺考名单', isLogin: true }
    },
    {
      path: '/batchscanning',
      name: 'Batchscanning',
      component: Batchscanning,
      meta: { title: '考试概览-批次扫描', isLogin: true }
    },
    {
      path: '/abnormalexamnumber',
      name: 'Abnormalexamnumber',
      component: Abnormalexamnumber,
      meta: { title: '考试概览-考号异常处理', isLogin: true }
    },
    {
      path: '/abnormalrating',
      name: 'Abnormalrating',
      component: Abnormalrating,
      meta: { title: '考试概览-打分异常处理', isLogin: true }
    },
    {
      path: '/optionexception',
      name: 'Optionexception',
      component: Optionexception,
      meta: { title: '考试概览-选项异常处理', isLogin: true }
    },
    {
      path: '/recognitionresult',
      name: 'Recognitionresult',
      component: Recognitionresult,
      meta: { title: '考试概览-识别结果', isLogin: true }
    },
    {
      path: '/studentinfo',
      name: 'Studentinfo',
      component: Studentinfo,
      meta: { title: '学校管理-学生信息', isLogin: true }
    },
    {
      path: '/teacherinfo',
      name: 'Teacherinfo',
      component: Teacherinfo,
      meta: { title: '学校管理-教师管理', isLogin: true }
    },
    {
      path: '/grademanagement',
      name: 'Grademanagement',
      component: Grademanagement,
      meta: { title: '学校管理-年级管理', isLogin: true }
    },
    {
      path: '/classmanagement',
      name: 'Classmanagement',
      component: Classmanagement,
      meta: { title: '学校管理-班级管理', isLogin: true }
    },
    {
      path: '/subjectmanagement',
      name: 'Subjectmanagement',
      component: Subjectmanagement,
      meta: { title: '学校管理-科目管理', isLogin: true }
    },
    {
      path: '/subjectselectionmanagement',
      name: 'Subjectselectionmanagement',
      component: Subjectselectionmanagement,
      meta: { title: '学校管理-选科管理', isLogin: true }
    },
    {
      path: '/topicmanagement',
      name: 'Topicmanagement',
      component: Topicmanagement,
      meta: { title: '学校管理-题型管理', isLogin: true }
    },
    {
      path: '/taskset',
      name: 'Taskset',
      component: Taskset,
      meta: { title: '学校管理-任务设置', isLogin: true }
    },
    {
      path: '/downloadcenter',
      name: 'Downloadcenter',
      component: Downloadcenter,
      meta: { title: '首页-下载中心', isLogin: true }
    },
    {
      path: '/personalinfor',
      name: 'Personalinfor',
      component: Personalinfor,
      meta: { title: '首页-个人信息', isLogin: true }
    },
    {
      path: '/accountinfo',
      name: 'Accountinfo',
      component: Accountinfo,
      meta: { title: '首页-账号安全', isLogin: true }
    },
    {
      path: '/messagecenter',
      name: 'Messagecenter',
      component: Messagecenter,
      meta: { title: '首页-消息中心', isLogin: true }
    },
    {
      path: '/homework',
      name: 'Homework',
      component: Homework,
      meta: { title: '作业管理', isLogin: true }
    },
    {
      path: '/studentscore',
      name: 'Studentscore',
      component: Studentscore,
      meta: { title: '作业管理', isLogin: true }
    },
    {
      path: '/homeidenificationrecord',
      name: 'Homeidenificationrecord',
      component: Homeidenificationrecord,
      meta: { title: '识别记录', isLogin: true }
    },
    {
      path: '/errorwork',
      name: 'Errorwork',
      component: Errorwork,
      meta: { title: '本次错题', isLogin: true }
    },
    {
      path: '/homeabnormalexamnumber',
      name: 'Homeabnormalexamnumber',
      component: Homeabnormalexamnumber,
      meta: { title: '填涂异常', isLogin: true }
    },
    {
      path: '/homeoptionexception',
      name: 'Homeoptionexception',
      component: Homeoptionexception,
      meta: { title: '选项异常', isLogin: true }
    },
    {
      path: '/homeabnormalrating',
      name: 'Homeabnormalrating',
      component: Homeabnormalrating,
      meta: { title: '打分异常', isLogin: true }
    },
    {
      path: '/mark',
      name: 'mark',
      component: mark,
      meta: { title: '', isLogin: true }
    },
    {
      path: '/unablefindanswersheet',
      name: 'Unablefindanswersheet',
      component: Unablefindanswersheet,
      meta: { title: '无法识别的作业', isLogin: true }
    },
    {
      path: '/dddimage',
      name: 'Dddimage',
      component: Dddimage,
      meta: { title: '学校管理-任务设置', isLogin: true }
    },
    {
      path: '/gradescoreindex',
      name: 'Gradescoreindex',
      component: Gradescoreindex,
      meta: { title: '成绩管理', isLogin: true }
    },
    {
      path: '/academiclevelsetting',
      name: 'Academiclevelsetting',
      component: Academiclevelsetting,
      meta: { title: '学业水平设置', isLogin: true }
    },
    {
      path: '/scorerangesetting',
      name: 'Scorerangesetting',
      component: Scorerangesetting,
      meta: { title: '分数段设置', isLogin: true }
    },
    {
      path: '/rankingsegmentsetting',
      name: 'Rankingsegmentsetting',
      component: Rankingsegmentsetting,
      meta: { title: '名次段设置', isLogin: true }
    },
    {
      path: '/classreport',
      name: 'Classreport',
      component: Classreport,
      meta: { title: '班级分析', isLogin: true }
    },
    {
      path: '/studentreport',
      name: 'Studentreport',
      component: Studentreport,
      meta: { title: '班级分析', isLogin: true }
    },
    // {
    // 	path: '/selectexam',
    // 	name: 'Selectexam',
    // 	component:Selectexam,
    // 	meta:{title:'百师云阅卷系统-选择考试'},
    // 	// isLogin:true
    // },
    // {
    // 	path: '/examregistration',
    // 	name: 'Examregistration',
    // 	component:Examregistration,
    // 	meta:{title:'百师云阅卷系统-选择考试报名'},
    // },
    // {
    // 	path: '/informationsettings',
    // 	name: 'Informationsettings',
    // 	component:Informationsettings,
    // 	meta:{title:'百师云阅卷系统-信息设置'},
    // },
    // {
    // 	path: '/examlist',
    // 	name: 'Examlist',
    // 	component:Examlist,
    // 	meta:{title:'百师云阅卷系统-考试列表'}
    // },
    // {
    // 	path: '/totalmarkingprogress',
    // 	name: 'Totalmarkingprogress',
    // 	component:Totalmarkingprogress,
    // 	meta:{title:'百师云阅卷系统-查看阅卷进度',isLogin:true}
    // },
    // {
    // 	path: '/exammanagemarkingprogress',
    // 	name: 'exammanagemarkingprogress',
    // 	component:exammanagemarkingprogress,
    // 	meta:{title:'百师云阅卷系统-学校阅卷进度',isLogin:true}
    // },
    // {
    // 	path: '/teachermarkingprogress',
    // 	name: 'Teachermarkingprogress',
    // 	component:Teachermarkingprogress,
    // 	meta:{title:'百师云阅卷系统-教师阅卷进度',isLogin:true}
    // },
    // {
    // 	path: '/taskallocation',
    // 	name: 'Taskallocation',
    // 	component:Taskallocation,
    // 	meta:{title:'百师云阅卷系统-任务分配',isLogin:true}
    // },
    // {
    // 	path: '/reportinformation',
    // 	name: 'Reportinformation',
    // 	component:Reportinformation,
    // 	meta:{title:'百师云阅卷系统-信息上报',isLogin:true}
    // },
    // {
    // 	path: '/mymission',
    // 	name: 'Mymission',
    // 	component:Mymission,
    // 	meta:{title:'百师云阅卷系统-我的任务',isLogin:true}
    // },
    //    {
    //      path: '/login',
    //      name: 'Login',
    //      component:Login,
    //      meta:{title:'百师云阅卷系统'}
    //    },
    // {
    //   path: '/markingquestions',
    //   name: 'Markingquestions',
    //   component:Markingquestions,
    //   meta:{title:'百师云阅卷系统',isLogin:true}
    // },
    // {
    // 	path: '/forgetpw',
    // 	name: 'Forgetpw',
    // 	component:Forgetpw,
    // 	meta:{title:'忘记密码'}
    // },
    // {
    // 	path:'/exammanagelevel',
    // 	name:'exammanagelevel',
    // 	component:exammanagelevel,
    // 	meta:{title:'考试列表'}
    // },
    // {
    //   path: '/analysismain',
    //   name: 'Analysismain',
    //   component:Analysismain,
    //   meta:{title:'百师云阅卷系统-校级分析'},
    //   children:[
    // 	  {
    // 	  	path:'exammanagelevelold',
    // 	  	name:'exammanagelevelold',
    // 	  	component:exammanagelevelold,
    // 	  	meta:{title:'校级总分统计'}
    // 	  },
    // 	  {
    // 	  	path:'onlineanalysis',
    // 	  	name:'Onlineanalysis',
    // 	  	component:Onlineanalysis,
    // 	  	meta:{title:'校级-上线达标分析'}
    // 	  },
    // 	  {
    // 		  path:'hitratecontribution',
    // 		  name:'Hitratecontribution',
    // 		  component:Hitratecontribution,
    // 		  meta:{title:'校级-命中率与贡献度'}
    // 	  },
    // 	  {
    // 		path:'fractiondistribution',
    // 		name:'Fractiondistribution',
    // 		component:Fractiondistribution,
    // 		meta:{title:'校级-分数段分布'}
    // 	  },
    // 	  {
    // 		path:'subjectanalysis',
    // 		name:'Subjectanalysis',
    // 		component:Subjectanalysis,
    // 		meta:{title:'校级-各学科分析'}
    // 	  },
    // 	  {
    // 		  path:'studentachievement',
    // 		  name:'Studentachievement',
    // 		  component:Studentachievement,
    // 		  meta:{title:'校级-学生成绩'}
    // 	  },
    // 	  {
    // 		path:'studentsmallquestion',
    // 		name:'Studentsmallquestion',
    // 		component:Studentsmallquestion,
    // 		meta:{title:'学生小题分'}
    // 	  },
    // 	  {
    // 		  path:'jointoverallstatistics',
    // 		  name:'Jointoverallstatistics',
    // 		  component:Jointoverallstatistics,
    // 		  meta:{title:'联考-总分统计'}
    // 	  },
    // 	  {
    // 		path:'gradedlaunch',
    // 		name:'Gradedlaunch',
    // 		component:Gradedlaunch,
    // 		meta:{title:'联考-分档上线情况'}
    // 	  },
    // 	  {
    // 		path:'paperqualityanalysis',
    // 		name:'Paperqualityanalysis',
    // 		component:Paperqualityanalysis,
    // 		meta:{title:'联考-试卷质量分析'}
    // 	  },
    // 	  {
    // 		path:'disciplineanalysis',
    // 		name:'Disciplineanalysis',
    // 		component:Disciplineanalysis,
    // 		meta:{title:'联考-各学科分析'}
    // 	  },
    // 	  {
    // 		path:'studentperformance',
    // 		name:'Studentperformance',
    // 		component:Studentperformance,
    // 		meta:{title:'联考-学生成绩'}
    // 	  },
    // 	  {
    // 	  	path:'/analysismain',
    // 	  	redirect:'/analysismain/exammanagelevelold'
    // 	  }
    //   ]
    // },
    // {
    // 	path: '/exammanagemangemain',
    // 	name: 'exammanagemangemain',
    // 	component:exammanagemangemain,
    // 	meta:{title:'百师云阅卷系统-学校管理'},
    // 	children:[
    // 		{
    // 			path:'exammanagebasicinfo',
    // 			name:'exammanagebasicinfo',
    // 			component:exammanagebasicinfo,
    // 			meta:{title:'基本信息'}
    // 		},
    // 		{
    // 			path:'contactsinfo',
    // 			name:'Contactsinfo',
    // 			component:Contactsinfo,
    // 			meta:{title:'联系人信息'}
    // 		},
    // 		{
    // 			path:'contactlist',
    // 			name:'Contactlist',
    // 			component:Contactlist,
    // 			meta:{title:'联系人信息'}
    // 		},
    // 		{
    // 			path:'teachermanagement',
    // 			name:'Teachermanagement',
    // 			component:Teachermanagement,
    // 			meta:{title:'教师信息'}
    // 		},
    // 		{
    // 			path:'studentmanagement',
    // 			name:'Studentmanagement',
    // 			component:Studentmanagement,
    // 			meta:{title:'学生信息'}
    // 		},
    // 		{
    // 			path:'onlineusers',
    // 			name:'Onlineusers',
    // 			component:Onlineusers,
    // 			meta:{title:'上线人数'}
    // 		},
    // 		{
    // 			path:'importstudent',
    // 			name:'Importstudent',
    // 			component:Importstudent,
    // 			meta:{title:'导入学生'}

    // 		},
    // 		{
    // 			path:'/exammanagemangemain',
    // 			redirect:'/exammanagemangemain/exammanagebasicinfo'
    // 		}
    // 	]
    // },
    // {
    // 	path:'/exammanagemangeselectexam',
    // 	name:'exammanagemangeselectexam',
    // 	component:exammanagemangeselectexam,
    // 	meta:{title:'选择考试'}
    // },
    // {
    //   path: '/classreport',
    //   name: 'Classreport',
    //   component:Classreport,
    //   meta:{title:'百师云阅卷助手'}
    //   // isLogin:true
    // },
    // {
    // 	path:'/questiondetail',
    // 	name:'Questiondetail',
    // 	component:Questiondetail,
    // 	meta:{title:'单题预览'}
    // },
    // {
    // 	path:'/exammanagedetail',
    // 	name:'exammanagedetail',
    // 	component:exammanagedetail,
    // 	meta:{title:'校级预览'}
    // },
    // {
    // 	path:'/jointexamination',
    // 	name:'Jointexamination',
    // 	component:Jointexamination,
    // 	meta:{title:'联考'}
    // },
    // {
    // 	path:'/examinationdetail',
    // 	name:'Examinationdetail',
    // 	component:Examinationdetail,
    // 	meta:{title:'联考预览'}
    // },
    // {
    // 	path:'/notice',
    // 	name:'Notice',
    // 	component:Notice,
    // 	meta:{title:'公告列表',isLogin:true},
    // 	children:[
    // 		{
    // 			path:'noticelist',
    // 			name:'Noticelist',
    // 			component:Noticelist,
    // 			meta:{title:'公告列表'}
    // 		},
    // 		{
    // 			path:'noticedetail',
    // 			name:'Noticedetail',
    // 			component:Noticedetail,
    // 			meta:{title:'公告列表详情'}
    // 		}
    // 	]
    // },
    // {
    // 	path:'/mobile',
    // 	name:'Mobile',
    // 	component:Mobile,
    // 	meta:{title:'百师云阅卷系统',isLogin:true}
    // },
    // {
    // 	path:'/reviewlist',
    // 	name:'Reviewlist',
    // 	component:Reviewlist,
    // 	meta:{title:'回评列表',isLogin:true}
    // },
    // {
    // 	path:'/reviewcon',
    // 	name:'Reviewcon',
    // 	component:Reviewcon,
    // 	meta:{title:'回评',isLogin:true}
    // },
    // {
    // 	path:'/uploadcardselectexam',
    // 	name:'Uploadcardselectexam',
    // 	component:Uploadcardselectexam,
    // 	meta:{title:'选择考试',isLogin:true}
    // },
    // {
    // 	path:'/answercard',
    // 	name:'Answercard',
    // 	component:Answercard,
    // 	meta:{title:'上传答题卡',isLogin:true}
    // },
    // {
    // 	path:'/uploadcard',
    // 	name:'Uploadcard',
    // 	component:Uploadcard,
    // 	meta:{title:'答卷上传',isLogin:true}
    // },
    // {
    // 	path:'/answercardcircle',
    // 	name:'Answercardcircle',
    // 	component:Answercardcircle,
    // 	meta:{title:'上传答题卡',isLogin:true}
    // },
    // {
    // 	path:'/answercardlist',
    // 	name:'Answercardlist',
    // 	component:Answercardlist,
    // 	meta:{title:'答题卡列表',isLogin:true}

    // },
    // {
    // 	path:'/reviseanswercard',
    // 	name:'Reviseanswercard',
    // 	component:Reviseanswercard,
    // 	meta:{title:'答题卡列表',isLogin:true}
    // },
    // {
    // 	path:'/notuploaded',
    // 	name:'Notuploaded',
    // 	component:Notuploaded,
    // 	meta:{title:'未上传的学生列表',isLogin:true}
    // },
    // {
    // 	path:'/adminselectexam',
    // 	name:'Adminselectexam',
    // 	component:Adminselectexam,
    // 	meta:{title:'选择考试',isLogin:true}
    // },
    // {
    // 	path:'/exammanagesinfo',
    // 	name:'exammanagesinfo',
    // 	component:exammanagesinfo,
    // 	meta:{title:'各校报名信息',isLogin:true}
    // },
    // {
    // 	path:'/uploadanswercards',
    // 	name:'Uploadanswercards',
    // 	component:Uploadanswercards,
    // 	meta:{title:'各校上传答题卡',isLogin:true}
    // },
    // {
    // 	path:'/exammanageprogress',
    // 	name:'exammanageprogress',
    // 	component:exammanageprogress,
    // 	meta:{title:'学校阅卷进度',isLogin:true}
    // },
    // {
    // 	path:'/subjectprogress',
    // 	name:'Subjectprogress',
    // 	component:Subjectprogress,
    // 	meta:{title:'学科进度',isLogin:true}
    // },
    // {
    // 	path:'/exammanagelist',
    // 	name:'exammanagelist',
    // 	component:exammanagelist,
    // 	meta:{title:'学校列表',isLogin:true}
    // },
    // {
    // 	path:'/barcode',
    // 	name:'Barcode',
    // 	component:Barcode,
    // 	meta:{title:'条形码',isLogin:true}
    // },
    // {
    // 	path:'/textscan',
    // 	name:'Textscan',
    // 	component:Textscan,
    // 	meta:{title:'扫描测试',isLogin:true}
    // },
    {
      path: '/',
      redirect: '/homework'
    },
    {
      path: '*',
      component: NotFoundComponent,
      meta: { title: '页面丢失' }
    }
  ]
})

export default router
//路由全局守卫功能
router.beforeEach((to, from, next) => {
  if (from.matched.length == 0) {
    let TokenKey = 'Admin-Token';
    if (process.env.NODE_ENV != 'production') {
      TokenKey = 'Test-Admin-Token';
    }

    const adminToken = Cookies.get(TokenKey);
    if (adminToken) {
      localStorage.setItem('token', adminToken)
      window.sessionStorage["ISlogin"] = true;
      get('/teacher/teacherinfo').then(res => {
        if (res.code == 200) {
          const encryptData = encrypt(JSON.stringify(res.data))
          localStorage.setItem('accessToken', encryptData);
        }
      })
    }
  }
  //判断是否登录进入
  const token = localStorage.getItem("token")
  if (to.matched.some(record => record.meta.isLogin)) {  // 判断该路由是否需要登录权限
    if (token) {  // 判断当前的token是否存在
      next();
      //   //console.info('11111')
    }
    else {
      // console.info('2222')
      //   next({
      //     path: '/login'
      //   })
      window.location.href = loginPath
      // window.location.href = 'http://localhost:8082/login'
    }
  } else {
    // //console.log(to.matched,'111111111111111');
    //   //console.info('3333')
    next();
  }
  // 根据路由元信息设置文档标题
  window.document.title = to.meta.title
  // 让页面回到顶部
  document.body.scrollTop = document.documentElement.scrollTop = 0;
  next()
})

const VueRouterPush = Router.prototype.push
Router.prototype.push = function push(to) {
  return VueRouterPush.call(this, to).catch(err => err)
}
